 <{extends file="<{$tempdir}>/public/admin.html"}>
   <{block name=extendjs}>
<script type="text/javascript" language="javascript" src="<{$siteurl}>/templates/<{$tempdir}>/public/js/artdialog/plugins/iframeTools.js"></script>
<script type="text/javascript" language="javascript" src="<{$siteurl}>/templates/<{$tempdir}>/public/js/chart/highcharts.js"></script>
<script type="text/javascript" language="javascript" src="<{$siteurl}>/templates/<{$tempdir}>/public/js/chart/modules/exporting.js"></script>
<script type="text/javascript">


			function gotolink(obj){
			  var checkvalue = $(obj).val();
			  var linkis = siteurl+'/index.php?ctrl=adminpage&action=analysis&module=area&selecttype=@selecttype@';
		   	window.location.href= linkis.replace('@selecttype@', checkvalue);
     }
		</script>


 <{/block}>
 <{block name=controlname}>区域销售数据<{/block}>
 <{block name=bodylist}>
   <div style="width:auto;overflow-x:hidden;overflow-y:auto">




           <div class="tags">



          <div id="tagscontent">
<div style="text-align:center;height:30px;line-height:30px;widht:100%;">
            	 <input type="checkbox" name="selecttype" value="0" <{if empty($selecttype)}>checked<{/if}> onclick="gotolink(this);">所有
            	 <input type="checkbox" name="selecttype" value="1" <{if $selecttype == 1}>checked<{/if}> onclick="gotolink(this);">最近1月
            	 <input type="checkbox" name="selecttype" value="2"  <{if $selecttype == 2}>checked<{/if}> onclick="gotolink(this);">最近一周
            	 <input type="checkbox" name="selecttype" value="3"  <{if $selecttype == 3}>checked<{/if}> onclick="gotolink(this);">当天
 </div>
            <div id="con_one_1">

              <div class="table_td" style="margin-top:10px;">

               <div  id="container" style="min-width: 400px; height: 400px; margin: 0 auto">

              </div>


               <form method="post" action="" onsubmit="return remind();">
                  <table border="0" cellspacing="2" cellpadding="4" class="list" name="table" id="table" width="100%">
                    <thead>
                      <tr>
                        <th align="center">区域名称</th>
                        <th align="center">销售数量</th>

                      </tr>
                    </thead>
                     <tbody>
                     	<{foreach from=$arealist item=items}>
                     	 <tr>

                        <td align="center"><{$items['name']}></td>
                        <td align="center"><{$items['shuliang']|default:'0'}></td>

                      </tr>
                      <{/foreach}>
                    </tbody>
                  </table>
               </form>



                <div class="page_newc">

                 </div>

                <div class="blank20"></div>

              </div>

            </div>

          </div>

        </div>


  </div>

</div>
 <script type="text/javascript">
$(function () {
    var chart;
    var jsarray = new Array();
    var tempdata = <{$arealist|json_encode}>;

    $(document).ready(function() {
        chart = new Highcharts.Chart({
            chart: {
                renderTo: 'container',
                plotBackgroundColor: null,
                plotBorderWidth: null,
                plotShadow: false
            },
            title: {
                text: '区域销售数据'
            },
            tooltip: {
                formatter: function() {
                    return '<b>'+ this.point.name +'</b>: '+ this.percentage +' %';
                }
            },
            plotOptions: {
                pie: {
                    allowPointSelect: true,
                    cursor: 'pointer',
                    dataLabels: {
                        enabled: true,
                        color: '#000000',
                        connectorColor: '#000000',
                        formatter: function() {
                            return '<b>'+ this.point.name +'</b>: '+ this.percentage +' %';
                        }
                    }
                }
            },
            series: [{
                type: 'pie',
                name: 'Browser share',
                data: [
                <{foreach from=$arealist key=mykey item=items}>
                    ['<{$items['name']}>',   changeTwoDecimal(<{$items['shuliang']}>/<{$total}>) ] <{if $mykey==$allshu-1}><{else}>,<{/if}>
               <{/foreach}>
                ]
            }]
        });
    });
    function changeTwoDecimal(floatvar)
{
var f_x = parseFloat(floatvar);
if (isNaN(f_x))
{
alert('暂无数据');
return false;
}
var f_x = Math.round(floatvar*100)/100;
return f_x;
}
});
		</script>
<!--newmain 结束-->
<{/block}>